#include<bits/stdc++.h>
using namespace std;
int main()
{
	int x;cin>>x;
	int j=0,jj=0;
	int suml=-1,sumr=0;
	while(suml!=sumr){
		suml=-1;
		sumr=0;
		j=jj;
		suml+=1;
		for(int i=0;i<x+1;i++){
			suml+=j*j;
			j+=1;
		}
		for(int i=0;i<x;i++){
			sumr+=j*j;
			j+=1;
		}
		jj++;
	}
	for(int i=0;i<x+1;i++){
		if(i>0){
			cout<<"+ ";
		}
		cout<<jj+i-1<<"^2 ";
	}
	cout<<"=\n";
	for(int i=0;i<x;i++){
		if(i>0){
			cout<<" + ";
		}
		cout<<jj+x+i<<"^2";
	}
	return 0;
}